package com.li.onjava8.concurrent.es.task;

import java.util.concurrent.Callable;

/**
 * @author li
 * @date 2023/10/30 14:30
 */
public class CountingTask implements Callable<Integer> {
    final int id;

    public CountingTask(int id) {
        this.id = id;
    }


    @Override
    public Integer call() {
        Integer val = 0;
        for(int i = 0; i < 100; i++)
            val++;
        System.out.println(id + " " + Thread.currentThread().getName() + " " + val);
        return val;
    }
}
